#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include <math.h>
int judge(int b, int a)
{
	for (b; b <= sqrt(a); b++)
	{
		if (a % b == 0)
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	int N = 0;
	scanf("%d", &N);
	int arr1[10001];
	int a = 2;
	int b;
	int x = 0; 
	int m;
	arr1[0] = 2;
	while (a < N)
	{
		x++;
		do
		{
			a++;
			b = 2;
			m=judge(b, a);
			if (m)
			{
				arr1[x] = a;
			}
		} while(!m);
	}
	int count = 0;
	int i = 0;
	while (arr1[i + 1] <= N)
	{
		if (arr1[i + 1] - arr1[i] == 2)
		{
			count++;
		}
		i++;
	}
	printf("%d", count);
	return 0;
}
